home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / Libraries / DCLAP 6d / dclap6d / DClap / DViewCentral.h < prev    next >
Encoding:
Text File  |  1996-07-05  |  1.3 KB  |  46 lines  |  [TEXT/R*ch]

  1. // DViewCentral.h
  2. // d.g.gilbert
  3.  
  4. #ifndef _DVIEWCENTRAL_
  5. #define _DVIEWCENTRAL_
  6.  
  7. #include "DView.h"
  8. #include "Dvibrant.h"
  9.  
  10. class DList;
  11.  
  12. // original use for DViewCentral class was to link nlmObjects to DViews.
  13. // That need may be gone.  Other use:
  14. // find any view given a view id -- is that useful to handle view tasks?
  15. // still likely need this to use MenuItem views...
  16. //
  17.  
  18. class DViewCentral : public DObject
  19. {    
  20.     DList*        fViewRegistry;  
  21. public:
  22.     DViewCentral();
  23.     virtual ~DViewCentral();
  24.     void RegisterView(DView* theView);
  25.     void RegisterView(long id, Nlm_Handle nlmObject, short kind, DTaskMaster* itsSource);
  26.     void RemoveView(long id);
  27.     
  28.     void DoViewMethod(long id, ViewMethod vmethod); 
  29.     void EnableView(long id)     { this->DoViewMethod(id, &DView::Enable); }
  30.     void DisableView(long id) { this->DoViewMethod(id, &DView::Disable); }
  31.     void ShowView(long id)         { this->DoViewMethod(id, &DView::Show); }
  32.     void HideView(long id)         { this->DoViewMethod(id, &DView::Hide); }
  33.     void InvalidateView(long id) { this->DoViewMethod(id, &DView::Invalidate); }
  34.     void SelectView(long id)     { this->DoViewMethod(id, &DView::Select); }
  35.     void ResetView(long id)     { this->DoViewMethod(id, &DView::Reset); }
  36.     
  37.     DView* GetView(long id);
  38.     DView* NlmItem2View(Nlm_Handle nlmObject);
  39.     Nlm_Handle View2NlmItem(long id);
  40. };
  41.  
  42.  
  43. extern DViewCentral *gViewCentral;
  44.  
  45. #endif
  46.